home *** CD-ROM | disk | FTP | other *** search
- #define CURSES_LIBRARY 1
- #include <curses.h>
-
- #ifdef PDCDEBUG
- char *rcsid__fixcurs = "$Header: C:\CURSES\private\RCS\_fixcurs.c 2.1 1993/06/18 20:23:18 MH Rel MH $";
- #endif
-
-
-
-
- /*man-start*********************************************************************
-
- PDC_fix_cursor() - Fix the cursor start and stop scan lines (if necessary)
-
- PDCurses Description:
- This is a private PDCurses routine.
-
- This routine will fix the cursor shape for certain video adapters.
- Normally, the values used are correct, but some adapters choke.
- The most noticable choke is on a monochrome adapter. The "correct"
- scan lines will result in the cursor being set in the middle of the
- character cell, rather than at the bottom.
-
- The passed flag indicates whether the cursor is visible or not.
-
- This only applies to the DOS platform.
-
- PDCurses Return Value:
- This function returns OK on success and ERR on error.
-
- PDCurses Errors:
- No errors are defined for this function.
-
- Portability:
- PDCurses int PDC_fix_cursor( int flag );
-
- **man-end**********************************************************************/
-
- int PDC_fix_cursor(int flag)
- {
- #ifdef DOS
-
- #ifdef PDCDEBUG
- if (trace_on) PDC_debug("PDC_fix_cursor() - called\n");
- #endif
-
- #ifdef FLEXOS
- return( OK );
- #endif
-
- if (_cursvar.bogus_adapter)
- return( OK );
-
- switch (_cursvar.adapter)
- {
- case _EGACOLOR:
- case _EGAMONO:
- case _MDS_GENIUS: /* Some clones look like a Genius;-) */
- if (flag & 0x01)
- setdosmembyte (0x487, getdosmembyte (0x487) | 0x01); /* Enable emulation */
- else
- setdosmembyte (0x487, getdosmembyte (0x487) & ~0x01); /* Disable emulation */
- break;
-
- case _VGACOLOR:
- case _VGAMONO:
- if (flag & 0x01)
- regs.x.ax = 0x1200; /* Enable emulation */
- else
- regs.x.ax = 0x1201; /* Disable emulation */
- regs.h.bl = 0x34;
- int86(0x10, ®s, ®s);
-
- break;
-
- case _MCGACOLOR:
- case _MCGAMONO:
- case _MDA:
- case _CGA:
- case _NONE:
- default:
- break;
- }
- return( OK );
- #endif
-
- #ifdef OS2
- return( OK );
- #endif
-
- #ifdef UNIX
- return( OK );
- #endif
- }
-